<%@ Page Language="VB" MasterPageFile="~/Admin/Admin.master" AutoEventWireup="false" CodeFile="AssessmentActivities.aspx.vb" Inherits="Admin_AssessmentActivities" title="Assessment Admin - Activities" %>
<%@ Register Src="AssessmentSubNavControl.ascx" TagName="AssessmentSubNavControl" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" Runat="Server">
<script language="javascript">
    function ToggleTemplateImage(templateDropDownListName, templateImageName, imageName) {
        var templateDropDownList = document.getElementById(templateDropDownListName);
        var templateImage = document.getElementById(templateImageName);
        var selectedItem;
        if (templateDropDownList != null) {
            selectedItem = templateDropDownList.options[templateDropDownList.selectedIndex].text;
            imageName = selectedItem.split('.')[0];
            templateImage.src = '../images/' + imageName + '.gif';
        }
    }
</script>

    <uc1:AssessmentSubNavControl ID="AssessmentSubNavControl1" runat="server" />
<div style="height:305px">
<div id="PageDiv" runat="server" style="position:relative; left:16px; top:16px; width:948px; height:260px; overflow:auto;">

    <asp:Panel ID="ActivitiesPanel" runat="server">
    <table border="0" cellpadding="4" cellspacing="0" style="font-family:MS Sans Serif, Arial, Verdana, Sans-Serif; font-size: 1em;">
        <tr>
            <td style="font-weight:bold; color:#21334B;">Admin - Assessment Activities</td>
            <td align="right">
                <asp:Button ID="ViewTemplatesButton" runat="server" Text="View Templates" />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:GridView ID="AssessmentActivityGridView" runat="server" HorizontalAlign="center" Width="825px" CellPadding="5" 
                        AutoGenerateColumns="False" BorderColor="#21334B" DataKeyNames="AssessmentActivityId,AssessmentTemplateId" BorderStyle="Solid" GridLines="Vertical">
                    <HeaderStyle CssClass="adminHeaderStyle" BackColor="#C3CAD4" BorderColor="#21334B" VerticalAlign="Top" />
                    <RowStyle CssClass="adminColumnStyle" />
                        <Columns>
                            <asp:TemplateField HeaderText="Assessment Activity" SortExpression="Description">
                                <HeaderStyle HorizontalAlign="Center" VerticalAlign="Bottom" />
                                <ItemStyle HorizontalAlign="Left" VerticalAlign="Middle" Width="50%" />
                                <ItemTemplate>
                                    <%# Eval("Description") %>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="ActivityNameTextBox" runat="server" Width="98%" Text='<%#Eval("Description")%>'></asp:TextBox>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Template Control" SortExpression="ControlName">
                                <ItemStyle Width="30%" />
                                <ItemTemplate>
                                    <%#Eval("ControlName")%>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:DropDownList ID="TemplateDropDownList" runat="server"></asp:DropDownList>
                                </EditItemTemplate>
                            </asp:TemplateField>
                            <asp:CommandField ShowEditButton="True" HeaderText="Action" AccessibleHeaderText="Action">
                                <ItemStyle HorizontalAlign="center" Width="10%" />
                            </asp:CommandField>
                            <asp:TemplateField HeaderText="Delete">
                                <ItemTemplate>
                                    <asp:Linkbutton ID="DeleteButton" CommandName="DeleteActivity" CommandArgument='<%# Eval("AssessmentActivityId") %>' runat="server" Text="Delete"></asp:Linkbutton>
                                </ItemTemplate>
                                <ItemStyle HorizontalAlign="Center" width="10%" />
                            </asp:TemplateField>
                        </Columns>
                    <AlternatingRowStyle BackColor="#E8ECF4" />
                </asp:GridView>                    
            </td>
        </tr>
    </table>
    </asp:Panel>
    <asp:Panel ID="AddNewPanel" runat="server" Visible="false">
        <table border="0" cellpadding="4" cellspacing="0">
            <tr>
                <td colspan="2"><b>New Assessment Activity</b></td>
            </tr>
            <tr>
                <td align="right" valign="top">
                    <asp:Label ID="ActivityNameLabel" runat="server" AssociatedControlID="NewActivityNameTextBox" Text="Activity Name:"></asp:Label>
                </td>
                <td align="left" valign="top">
                    <asp:TextBox ID="NewActivityNameTextBox" runat="server"></asp:TextBox>
                </td>
            </tr>
            <tr style="height: 175px;">
                <td align="right" valign="top">
                    <asp:Label ID="TemplateNameLabel" runat="server" AssociatedControlID="NewTemplateDropDownList" Text="Template Name:"></asp:Label>
                </td>
                <td align="left" valign="top">
                    <asp:DropDownList ID="NewTemplateDropDownList" runat="server"></asp:DropDownList>
                    <br />
                    <br />
                    Template Preview:
                    <br />
                    <asp:Image ID="TemplateImage" runat="server"></asp:Image>
                </td>
            </tr>
            <tr>
                <td align="right" valign="top">
                    <asp:Label ID="AssessmentCategoryLabel" runat="server" AssociatedControlID="NewAssessmentCategoryDropDownList" Text="Assessment Category:"></asp:Label>
                </td>
                <td align="left" valign="top">
                    <asp:DropDownList ID="NewAssessmentCategoryDropDownList" runat="server"></asp:DropDownList>
                </td>
            </tr>
            <tr>
                <td align="right" valign="top">
                    <asp:Label ID="CostLabel" runat="server" AssociatedControlID="CostTextBox" Text="Activity Cost:"></asp:Label>
                </td>
                <td align="left" valign="top">
                    <asp:TextBox ID="CostTextBox" runat="server"></asp:TextBox>                    
                </td>
            </tr>
            <tr>
                <td align="right" valign="top">
                    <asp:Label ID="ActivityFunctionalCostLabel" runat="server" AssociatedControlID="FunctionalCostTextBox" Text="Activity Functional Cost:"></asp:Label>
                </td>
                <td align="left" valign="top">
                    <asp:TextBox ID="FunctionalCostTextBox" runat="server"></asp:TextBox>                    
                </td>
            </tr>
            <tr>
                <td align="right" valign="top">
                    <asp:Label ID="EffectiveDateLabel" runat="server" AssociatedControlID="EffectiveDateCalendar" Text="Effective Date:"></asp:Label>
                </td>
                <td align="left" valign="top">
                    <asp:Calendar ID="EffectiveDateCalendar" runat="server" BackColor="White" BorderColor="White" BorderWidth="1px" Font-Names="Verdana" Font-Size="9pt" ForeColor="Black" Height="190px" NextPrevFormat="FullMonth" Width="350px">
                            <SelectedDayStyle BackColor="#333399" ForeColor="White" />
                            <TodayDayStyle BackColor="#CCCCCC" />
                            <OtherMonthDayStyle ForeColor="#999999" />
                            <NextPrevStyle Font-Bold="True" Font-Size="8pt" ForeColor="#333333" VerticalAlign="Bottom" />
                            <DayHeaderStyle Font-Bold="True" Font-Size="8pt" />
                            <TitleStyle BackColor="White" BorderColor="Black" BorderWidth="4px" Font-Bold="True"
                                Font-Size="9pt" ForeColor="#333399" />
                    </asp:Calendar>
                </td>
            </tr>
            <tr>
                <td></td>
                <td>
                    <asp:Button ID="SaveButton" runat="server" Text="Save" />&nbsp;
                    <asp:Button ID="CancelButton" runat="server" Text="Cancel" />
                </td>
            </tr>
        </table>    
        <br />
        <br />
        <br />
    </asp:Panel>
    
    <asp:Panel ID="TemplateKeyPanel" runat="server" Visible="false">

    <table border="0" cellpadding="4" cellspacing="0" style="background-color: WhiteSmoke; border:solid 1px black; MS Sans Serif, Arial, Verdana, Sans-Serif; font-size: 8pt;">
        <tr>
            <td style="font-size:10pt;"><b>Template Key</b></td>
            <td align="right"><asp:Button ID="CloseTemplateKeyButton" runat="server" Text="Close" /></td>
        </tr>
        <tr>
            <td style="width: 20%" align="right" valign="top">Template One:</td>
            <td style="width: 80%">
                <img src="../images/TemplateOne.gif" alt="Template One Screen Shot" />
            </td>
        </tr>
        <tr>
            <td style="width: 20%" align="right" valign="top">Template Two:</td>
            <td style="width: 80%">
                <img src="../images/TemplateTwo.gif" alt="Template Two Screen Shot" />
            </td>
        </tr>
        <tr>
            <td style="width: 20%" align="right" valign="top">Template Three:</td>
            <td style="width: 80%">
                <img src="../images/TemplateThree.gif" alt="Template Three Screen Shot" />
            </td>
        </tr>
        <tr>
            <td style="width: 20%" align="right" valign="top">Template Four:</td>
            <td style="width: 80%">
                <img src="../images/TemplateFour.gif" alt="Template Four Screen Shot" />
            </td>
        </tr>                
    </table>
    
    </asp:Panel>

</div>

</div>
</asp:Content>

<asp:Content ID="FixedContent" runat="server" ContentPlaceHolderID="ContentPlaceHolderFixedAdmin">
        <asp:Button ID="AddNewButton" runat="server" Text="Add New" />
</asp:Content>

